*******************************************************************************************
********** Indigenous Identity, Natural Resources and Social Conflict in Bolivia **********
**********                        Replication File                               **********
*******************************************************************************************

**************************
** 1. Load Data
**************************

*change working directory
clear
cd "~/Dropbox/GIGA/ERC/AnalysisBolivia/Replication_Archive"

use "SocialConflictBolivia.dta"

**************************
** 2. Final Tables
**************************

xtset Depart_x

* Table 1
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum lincshare i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum elf pol i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum cross_indig i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum i.Year_x i.Depart_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum lincshare elf pol cross_indig i.Year_x i.Depart_x,r cluster(Province)

* Table X2
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count totrevpc c.gas_count##c.indig_dum i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count totrevpc c.gas_count##c.indig_dum lincshare i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count totrevpc c.gas_count##c.indig_dum elf pol i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count totrevpc c.gas_count##c.indig_dum cross_indig i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count totrevpc c.gas_count##c.indig_dum i.Year_x i.Depart_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count totrevpc c.gas_count##c.indig_dum lincshare elf pol cross_indig i.Year_x i.Depart_x,r cluster(Province)


* Table X3
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count i.gas##c.indig_dum i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count i.gas##c.indig_dum lincshare i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count i.gas##c.indig_dum elf pol i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count i.gas##c.indig_dum cross_indig i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count i.gas##c.indig_dum i.Year_x i.Depart_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count i.gas##c.indig_dum lincshare elf pol cross_indig i.Year_x i.Depart_x,r cluster(Province)


*Table X4
nbreg resourceevents lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum i.Year_x,r cluster(Province)
nbreg resourceevents lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum lincshare i.Year_x,r cluster(Province)
nbreg resourceevents lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum elf pol i.Year_x,r cluster(Province)
nbreg resourceevents lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum cross_indig i.Year_x,r cluster(Province)
nbreg resourceevents lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum i.Year_x i.Depart_x,r cluster(Province)
nbreg resourceevents lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum lincshare elf pol cross_indig i.Year_x i.Depart_x,r cluster(Province)


* Table X5
nbreg numbinjured lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum i.Year_x,r cluster(Province)
nbreg numbinjured lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum lincshare i.Year_x,r cluster(Province)
nbreg numbinjured lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum elf pol i.Year_x,r cluster(Province)
nbreg numbinjured lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum cross_indig i.Year_x,r cluster(Province)
nbreg numbinjured lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum i.Year_x i.Depart_x,r cluster(Province)
nbreg numbinjured lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum lincshare elf pol cross_indig i.Year_x i.Depart_x,r cluster(Province)
esttab using example9.tex,se ar2 scalars(N F aic) label title(Violence in Bolivia) mtitles("NegBin" "NegBin" "NegBin" "NegBin" "NegBin" "NegBin") star(+ 0.10 * 0.05 ** 0.01 *** 0.001)
eststo clear

* Table X6
nbreg govreact2 freq lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum i.Year_x,r cluster(Province)
nbreg govreact2 freq lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum lincshare i.Year_x,r cluster(Province)
nbreg govreact2 freq lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum elf pol i.Year_x,r cluster(Province)
nbreg govreact2 freq lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum cross_indig i.Year_x,r cluster(Province)
nbreg govreact2 freq lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum i.Year_x i.Depart_x,r cluster(Province)
nbreg govreact2 freq lpop socecon lit_dum mnt2000 capdist roads_count c.gas_count##c.indig_dum lincshare elf pol cross_indig i.Year_x i.Depart_x,r cluster(Province)


* Table X7
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count oil_count quechua_dum aymara_dum guarani_dum oilquechua oilaymara oilguarani i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count oil_count quechua_dum aymara_dum guarani_dum oilquechua oilaymara oilguarani lincshare i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count oil_count quechua_dum aymara_dum guarani_dum oilquechua oilaymara oilguarani elf pol i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count oil_count quechua_dum aymara_dum guarani_dum oilquechua oilaymara oilguarani cross_indig i.Year_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count oil_count quechua_dum aymara_dum guarani_dum oilquechua oilaymara oilguarani i.Year_x i.Depart_x,r cluster(Province)
nbreg freq lpop socecon lit_dum mnt2000 capdist roads_count oil_count quechua_dum aymara_dum guarani_dum oilquechua oilaymara oilguarani lincshare elf pol cross_indig i.Year_x i.Depart_x,r cluster(Province)


